package com.shop2cn.iapi.coupon.service;

import org.json.JSONObject;

import com.shop2cn.iapi.coupon.parameter.GetUserValidSellerCouponsResp;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*我的优惠券数量Call
*FreeMaker Template自动生成代码
*/
public class getMyCouponNumCall extends YmatouBaseCall{
	private static String opurl ="api/Promotion/getMyCouponNum";
	
	public getMyCouponNumCall() {
		super(EnvSetup.getSystemUrl("coupon_shop2cn_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	  public String getStatusCode1()
	    {
	        return getString("statusCode");
	    }

	    public String getMessage()
	    {
	        return getString("message");
	    }

		public Integer getUsableCouponNum() {
			Integer Code = null;
			try {
				Code = new JSONObject(new JSONObject(getReturnData()).getString("data")).getInt("usableCouponNum");
			} catch (Exception e) {
				e.printStackTrace();
			}
			return Code;
		}

	  
}